package com.sskj.miner.http;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.request.GetRequest;
import com.lzy.okgo.request.PostRequest;
import com.sskj.common.base.HttpData;
import com.sskj.lib.bean.PageBean;
import com.sskj.miner.bean.ForceBean;
import com.sskj.miner.bean.MinerAssetBean;
import com.sskj.miner.bean.PaoBean;
import com.sskj.miner.bean.ProfileBean;
import com.sskj.miner.bean.RuleBean;

/**
 * 作者 :吕志豪
 * 简书：https://www.jianshu.com/u/6e525b929aac
 * github：https://github.com/lvzhihao100
 * 描述：
 * 创建时间：2018-10-15 14:08
 */
public class HttpService {

    public GetRequest<HttpData<MinerAssetBean>> getAsset() {
        return OkGo.<HttpData<MinerAssetBean>>get(HttpConfig.BASE_URL + HttpConfig.GET_ASSET);

    }

    public GetRequest<HttpData<RuleBean>> getRule() {
        return OkGo.<HttpData<RuleBean>>get(HttpConfig.BASE_URL + HttpConfig.GET_RULE);

    }

    public GetRequest<HttpData<PageBean<ForceBean>>> getForceList(String p, String size) {
        return OkGo.<HttpData<PageBean<ForceBean>>>get(HttpConfig.BASE_URL + HttpConfig.GET_FORCE_LIST)
                .params("pageNumber",p)
                .params("pageSize",size)
                ;

    }
    public GetRequest<HttpData<PageBean<ProfileBean>>> getProfileList(String p, String size,String code) {
        return OkGo.<HttpData<PageBean<ProfileBean>>>get(HttpConfig.BASE_URL + HttpConfig.GET_PROFILE_LIST)
                .params("stockCode",code)
                .params("pageNumber",p)
                .params("pageSize",size)
                ;

    }

    public GetRequest<HttpData<PaoBean>> getPao() {
        return OkGo.<HttpData<PaoBean>>get(HttpConfig.BASE_URL + HttpConfig.GET_PAO)

                ;
    }

    public PostRequest<HttpData> receivePao(String code, String num, String type, String largeType) {
        return OkGo.<HttpData>post(HttpConfig.BASE_URL + HttpConfig.RECEIVE_PAO)
                .params("stockCode",code)
                .params("num",num)
                .params("type",type)
                .params("largeType",largeType)
                ;

    }
}